//
//  AppDelegate+Pgyer.m
//  HelpYouReturn
//
//  Created by 帝云科技 on 2018/2/23.
//  Copyright © 2018年 diyunkeji. All rights reserved.
//

#import "AppDelegate+Pgyer.h"
//#import <PgySDK/PgyManager.h>
//#import <PgyUpdate/PgyUpdateManager.h>
//
//static NSString *const PGYAppKey = @"0d0a604ce363e87678cb5bc6177ac077";

@implementation AppDelegate (Pgyer)

//- (void)registPgyer
//{
//    ApiObject *api = [ApiObject api];
//    api.url = _Api_version;
//    [ApiReq POST:api callBack:^(ApiObject *obj) {
//        if (!obj.error)
//        {
//            if (obj.success)
//            {
//                NSDictionary *info=obj.content[@"info"];
//                NSString *currentVersion = [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"];
//                NSString *updateContent = info[@"version_info"];
//                NSString *downloadString =info[@"version_url"];
//                NSString *onlineVersion=info[@"version"];
//                NSComparisonResult comparisonResult = [currentVersion compare:onlineVersion options:NSNumericSearch];
//                if (comparisonResult==NSOrderedAscending) {
//                    //            NSLog(@" 本地版本号 < 线上版本号");
//                    [self showUpdateAlertWithMessage:updateContent urlString:downloadString];
//                }
//            }
//        }
//    }];
//}
//
//- (void)showUpdateAlertWithMessage:(NSString *)message urlString:(NSString *)urlString
//{
//    UIViewController *controller=[UIViewController xhq_currentController];
//    UIAlertController *alert = [XHQAlertManager alertActionCreateTitle:@"版本更新"
//                                                            andMassage:message
//                                                    setActionEnterText:@"更新"
//                                                   setActionCancelText:@"取消"
//                                                        setEnterAction:^(UIAlertAction *action) {
//                                                            [self updateVersion:urlString];
//                                                        }];
//    [controller presentViewController:alert animated:YES completion:nil];
//}
//
//- (void)updateVersion:(NSString *)urlString
//{
//    NSURL *url = [NSURL URLWithString:urlString];
//    if ([[UIApplication sharedApplication] canOpenURL:url])
//    {
//        [[UIApplication sharedApplication] openURL:url];
//    }
//}

@end
